<template>
  <view class="container">
    <view class="top-bar">
      <navigator class="back-btn" url="/pages/regularUser/regularUser">←</navigator>
      <text class="title">预约探访</text>
    </view>
    <view class="content">
      <view class="welcome-section">
        <text class="welcome-title">关爱老人，从陪伴开始</text>
        <text class="welcome-subtitle">为家中长辈预约志愿者探访服务</text>
      </view>

      <view class="options-container">

        <view class="option-card" @click="navigateToAppointmentList">
          <view class="card-icon">
            <text class="icon">📋</text>
          </view>
          <view class="card-content">
            <text class="card-title">我的预约</text>
            <text class="card-desc">查看和管理您的探访预约记录</text>
            <view class="stats">
              <text class="stat-item">待确认: {{pendingCount}}</text>
              <text class="stat-item">已完成: {{completedCount}}</text>
            </view>
          </view>
          <view class="card-arrow">
            <text>›</text>
          </view>
        </view>

        <view class="option-card primary" @click="navigateToNewAppointment">
          <view class="card-icon">
            <text class="icon">📅</text>
          </view>
          <view class="card-content">
            <text class="card-title">预约探访</text>
            <text class="card-desc">为家中老人预约志愿者探访服务</text>
            <view class="feature-list">
              <text class="feature-item">✓ 选择合适时间</text>
              <text class="feature-item">✓ 说明特殊需求</text>
              <text class="feature-item">✓ 匹配合适志愿者</text>
            </view>
          </view>
          <view class="card-arrow">
            <text>›</text>
          </view>
        </view>
      </view>

     
      <view class="service-info">
        <view class="info-title">
          <text class="title-text">服务说明</text>
        </view>
        <view class="info-items">
          <view class="info-item">
            <text class="info-icon">⏱️</text>
            <text class="info-text">每次探访1-3小时</text>
          </view>
          <view class="info-item">
            <text class="info-icon">👵</text>
            <text class="info-text">陪伴聊天、简单照料</text>
          </view>
          <view class="info-item">
            <text class="info-icon">✅</text>
            <text class="info-text">专业志愿者团队</text>
          </view>
          <view class="info-item">
            <text class="info-icon">💰</text>
            <text class="info-text">公益活动，无收费</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      pendingCount: 2,
      completedCount: 5
    }
  },
  methods: {
    navigateToAppointmentList() {
      uni.navigateTo({
        url: '/pages/regularUser/quickFuction/appointList/appointList'
      });
    },
    navigateToNewAppointment() {
      uni.navigateTo({
        url: '/pages/regularUser/quickFuction/appointment/appointment'
      });
    }
  }
}
</script>

<style>
page {
  background-color: #f8f8f8;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(180deg, #FFF7E6 0%, #FFFFFF 100%);
}

.top-bar {
  padding: 15px 20px;
  background-color: #FD995E;
  display: flex;
  align-items: center;
  height: 60px;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(255, 87, 34, 0.2);
}

.back-btn {
  font-size: 24px;
  color: white;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.2);
}

.title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-align: center;
  flex: 1;
}

.content {
  flex: 1;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}


.welcome-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
}

.welcome-title {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #F57F17;
  margin-bottom: 8px;
}

.welcome-subtitle {
  display: block;
  font-size: 15px;
  color: #666;
}


.options-container {
  margin-bottom: 30px;
}


.option-card {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.option-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.option-card.primary {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border: 1px solid #ffcc80;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.15);
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5722 0%, #ffcc80 100%);;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.option-card.primary .card-icon {
  background: linear-gradient(135deg, #ff5722 0%, #ffcc80 100%);
}

.icon {
  font-size: 24px;
}

.card-content {
  flex: 1;
}

.card-title {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.option-card.primary .card-title {
  color: #e65100;
}

.card-desc {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-item {
  font-size: 13px;
  color: #ff9800;
  background-color: #fff3e0;
  padding: 4px 8px;
  border-radius: 12px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feature-item {
  font-size: 13px;
  color: #e65100;
}

.card-arrow {
  font-size: 24px;
  color: #ccc;
  margin-left: 10px;
}

.option-card.primary .card-arrow {
  color: #ff9800;
}


.service-info {
  background-color: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.info-title {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.title-text {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.info-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.info-item {
  display: flex;
  align-items: center;
  width: calc(50% - 8px);
}

.info-icon {
  font-size: 16px;
  margin-right: 8px;
  color: #ff9800;
}

.info-text {
  font-size: 14px;
  color: #666;
}
</style>